Ext.define('WP.view.ReadRss', {
    extend: 'Ext.Panel',	
    alias: 'widget.readrss',  
    config: {
        titlePage: null,
	feedUrl : null,
	items :[{
		dock : 'top',
		xtype: 'toolbar',
		title: this.titlePage,
		ui   : 'light'
	}]
	
    },

    //load the config of our Ajax page
    initialize: function() {
        this.callParent(arguments);
	this.down('toolbar').setTitle(this.getTitlePage());
	
	var feedToload = this;
	var posts = Ext.create('WP.store.WpPosts', { storeId: 'WpPosts'});
	posts.setProxy({
	    type: 'jsonp',
	    url : feedToload.getFeedUrl(),
	    reader: {
		type: 'json',
		rootProperty: 'posts',
	        totalProperty: 'count_total',
	    }
	});
	posts.load({
	     callback: function(records, operation, success) {
		    // the operation object contains all of the details of the load operation
		    console.log(records);
		    this.setHtml('<p> Feed ajax loaded, Nb article :' + records.length +'</p><p>Show the console to see the record ;-)</p>');
		},
	    scope : feedToload
	});
	
    }
});